package com.sys.dispatch;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class JavaExeMethod {
	/**
	 * 执行bat程序
	 * @param command
	 * @throws Exception
	 */
	public boolean exeBat(String command) throws Exception{
		
		String ss="cmd /c "+command;
		Process process=Runtime.getRuntime().exec(ss);
		BufferedReader read = new BufferedReader(new InputStreamReader(process.getInputStream())); 
		String str="";
		boolean flag=false;
		while ((str=read.readLine())!= null) { 
			if("true".equals(str)){
				flag= true;
	        }
        } 
		System.out.println(flag);
        if(flag){
        	return true;
        }else{
        	return false;
        }
	}
}
